package com.heqiang.spring;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class BeanFactory {

    Map<String,BeanDefinition> beanMap = new ConcurrentHashMap<>();

    public Object getBean(String name) {
        return beanMap.get(name).getBean();
    }

    public void registerDefinitionBean(String name,BeanDefinition beanDefinition)  {
        beanMap.put(name,beanDefinition);
    }
}
